import Mock from 'better-mock';

import {
	ApiResult,
	bodyToObj,
	parseSceneBy,
	parseSceneByOptionsUrl,
	parseSceneByOptionsBody,
	arrayToMap,
	deleteArrayElementBy,
	deleteArrayElementByKv,
	PageData,
	toPageData,
} from './mock-util.js';


// mock数据
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


const tasks = [
	{
		"id": 1534,
		"title": "实验与作业1 Java语言开发环境搭建",
		"subtask": 4,
		"finshed": 4,
		"startTime": "2021-09-22 00:00:00",
		"stopTime": "2021-10-22 00:00:00",
		"status": 2
	},
	{
		"id": 1535,
		"title": "实验与作业2 Java语言基础语法练习",
		"subtask": 12,
		"finshed": 8,
		"startTime": "2021-10-22 00:00:00",
		"stopTime": "2021-11-22 00:00:00",
		"status": 1
	},
	{
		"id": 1536,
		"title": "实验与作业3 类与对象编程",
		"subtask": 9,
		"finshed": 0,
		"startTime": "2021-11-22 00:00:00",
		"stopTime": "2022-01-11 00:00:00",
		"status": 0
	}
];


// mock 设备详情
Mock.mock("/api/group/tasks", 'get', options => {
	const scene = parseSceneByOptionsUrl(options);
	const id = scene.id;
	
	return ApiResult.success(tasks);
});


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

